/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.rum.gui.component;

import cz.muni.fi.rum.gui.component.TreeModel.ReflectorNodeType;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;
import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author pmikulasek
 */
public class ReflectorNode/*<T>*/ extends DefaultMutableTreeNode implements Serializable{

    private final ReflectorNodeType type;
    private Object content;
    private final String id;
    private static AtomicLong idCounter = new AtomicLong();

    public ReflectorNode(ReflectorNodeType type, Object userObject) {
        super(userObject);
        this.type = type;
        this.id = String.valueOf(idCounter.getAndIncrement());
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public Object getContent() {
        return content;
    }

    public String getId() {
        return id;
    }
//
//        public T getValue(){
//            return (T) getUserObject();
//        }

    public ReflectorNodeType getType() {
        return type;
    }
}
